package com.shaoshaohuo.app.adapter;

import java.util.List;

import com.shaoshaohuo.app.R;
import com.shaoshaohuo.app.entity.GrabDriver;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class GrabOrderDriverListAdapter<T> extends MyBaseAdapter<GrabDriver> {

	public GrabOrderDriverListAdapter(Context ctx, List<GrabDriver> list, boolean flag) {
		super(ctx, list, flag);
	}

	@Override
	public View getView(int pos, View convertView, ViewGroup group) {
		
		ViewHolder holder;
        if (convertView == null) {
            convertView = View.inflate(context,R.layout.view_driver_list_item, null);
            holder = new ViewHolder();
            holder.titleText = (TextView) convertView.findViewById(R.id.textview_name);
            holder.priceText = (TextView) convertView.findViewById(R.id.textview_money);
//            holder.contentText = (TextView) convertView.findViewById(R.id.textview_amount);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }
		
        GrabDriver item = list.get(pos);
        
        holder.titleText.setText(item.getCaruserinfo().getRealname());
        holder.priceText.setText("￥"+item.getMoney());
//        holder.contentText.setText(msg.getBidmoney());
        
		return convertView;
	}
	
	static class ViewHolder{
		TextView titleText;
		TextView priceText;
	}
	
}
